<template>
  <div class="content footprintsShare">
    <THeader :active="this.$route.path"></THeader>
    <div>
      <ul>
        <li v-for="(item,index) in friendshare_items" :key="index">
          {{ item }}
        </li>
      </ul>
    </div>

    <el-container>
      <el-aside width="200px">
        <el-menu
          :default-active="`${activeIndex}`"
          @select="handleSelect"
          style="height: 100%;" @open="handleOpen" @close="handleClose" :collapse="isCollapse">
          <h4 :style="{fontSize:'16px',color:'#303133',textAlign:'center'}">好友分享</h4>
          <Divider/>
          <el-menu-item
            v-for="(item,index) in friendMenuList"
            :index="`${index}`" :key="index"
            :style="{height: '40px',lineHeight:'40px'}"
          >
            <span slot="title">{{item.title}}</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <router-view/>
    </el-container>

  </div>
  <!--联系方式-->
</template>

<script> 
  import friendMenuList from "./friendMenuList";

  //分享足迹
  export default {
    name: "footprintsShare",
    data() {
      return {
        friendshare_items: [],
        tabs: ["好友列表", "添加好友", "好友请求"],
        isCollapse: false,
        friendMenuList,
        activeIndex: 0,

      };
    },
    mounted() {
      const {tag} = this.$route.meta;
      if (!!tag) {
        this.activeIndex = tag;
      }
    },
    computed: {}, 
    methods: {
      handleOpen() {
        this.handleOpen = true;
      },
      handleClose() {
        this.handleOpen = false;
      },
      handleSelect(index) {
        const {path} = friendMenuList[index];
        if (path) {
          this.$router.push(`/footprints-share/${path}`)
        }
      }, 
    }
  };
</script>

<style lang="less">
  .body-card {
    min-height: 500px;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 3px;
    padding: 24px;
  }
</style>
